﻿using RayDen.RayEngine.Core.Interface;
using RayDen.RayEngine.Core.Types;

namespace RayDen.RayEngine.Core.Devices {

    public abstract class  IntersectionEngine  : IIntersectionEngine {
        protected IRayEngineScene scene;
        protected bool started;
        protected double statsTotalRayCount;
        protected long statsStartTime;
        protected string deviceName;

        public bool IsRunning {
            get { return started; }
        }

        public IntersectionEngine(IRayEngineScene scene) {
            this.scene = scene;
        }

        #region IIntersectionEngine Members

        public virtual void Trace(RayBuffer buffer) {
            
        }

        public double TotalRays
        {
            get { return statsTotalRayCount; }
        }

        public abstract void PushRayBuffer(RayBuffer rayBuffer,  int clientIdx);

        public abstract RayBuffer PopRayBuffer(int info);

        public abstract void Stop();
        public abstract void Start();

        public virtual void SetScene(IRayEngineScene scene) {}

        #endregion

        public virtual void Dispose() {}
    }
}